package com.qqtech.qquan.homemaking.model;

import java.math.BigDecimal;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

@SuppressWarnings("serial")
public class HomemakingBaseVo extends HomemakingBase {

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}
	
	/** 未完成的预约数量 */
	private Integer todoOrderCount;

	/** 距离 */
	private BigDecimal distance;

	private List<HomemakingItemVo> homemakingItemVo;
	
	/** 下单时候选择的项目 */
	private List<HomemakingPubitemVo> homemakingPubitemVos;
	
	/** 下单时候选择的时间 */
	private List<HomemakingTimeVo> homemakingTimeVos;

	/**
	 * 类别名
	 */
	private String typeStr;

	/* ui的模版顺序 */
	private Integer template = 0;

	/* ui的模版顺序 */
	private Integer rightTemplate = 1;

	/**
	 * 发布人的昵称
	 */
	private String nick;
	
	/**
	 * 营业状态:1-正常;2-暂停
	 */
	private String statusStr;
	
	/** 是否显示:1-是;2-否 */
	private String isShowStr;
	
	/**
	 * 发布城市名称
	 */
	private String cityName;
	
	/**
	 * 实名认证的个人正面照
	 */
	private String photosImg;
	
	/** 服务人员真实姓名 */
	private String realName;
	
	/** 评价的评分（平均值） */
	private Double feedbackScoreAvg;
	
	/** 评价的评分（平均值）整数 */
	private Integer feedbackScore;
	
    /** 创建人（或查询人）经度 */
	private BigDecimal x;
	
    /** 创建人（或查询人）纬度 */
	private BigDecimal y;
	
    /** 选择的日期，2016-06-21 */
	private java.lang.String serviceDateStr;
	
    /** 选择的时间，8 */
	private java.lang.String serviceHourStr;
	
	/** 籍贯 */
	private String birthPlace;
	
	/** 1-休息模式;2-上班模式 */
	private Integer isRestMode;
	/** 社区名称 */
	private String communityName;
	
	public Integer getIsRestMode() {
		return isRestMode;
	}

	public void setIsRestMode(Integer isRestMode) {
		this.isRestMode = isRestMode;
	}

	public BigDecimal getDistance() {
		return distance;
	}

	public void setDistance(BigDecimal distance) {
		this.distance = distance;
	}

	public String getDistanceStr() {
		String distanceStr = "";
		if (this.distance != null) {
			BigDecimal temp = new BigDecimal(1000.0);
			if (distance.compareTo(temp) > 0) {
				return distance.divide(temp, 1, BigDecimal.ROUND_HALF_UP).doubleValue()+ "公里";
	        } else {
	            return distance.intValue() + "米";
	        }
		}
		return distanceStr;
	}

	public List<HomemakingItemVo> getHomemakingItemVo() {
		return homemakingItemVo;
	}

	public void setHomemakingItemVo(List<HomemakingItemVo> homemakingItemVo) {
		this.homemakingItemVo = homemakingItemVo;
	}
	
	public List<HomemakingPubitemVo> getHomemakingPubitemVos() {
		return homemakingPubitemVos;
	}

	public void setHomemakingPubitemVos(List<HomemakingPubitemVo> homemakingPubitemVos) {
		this.homemakingPubitemVos = homemakingPubitemVos;
	}

	public List<HomemakingTimeVo> getHomemakingTimeVos() {
		return homemakingTimeVos;
	}

	public void setHomemakingTimeVos(List<HomemakingTimeVo> homemakingTimeVos) {
		this.homemakingTimeVos = homemakingTimeVos;
	}

	public String getTypeStr() {
		return typeStr;
	}

	public void setTypeStr(String typeStr) {
		this.typeStr = typeStr;
	}

	public Integer getTemplate() {
		return template;
	}

	public void setTemplate(Integer template) {
		this.template = template;
	}

	public Integer getRightTemplate() {
		return rightTemplate;
	}

	public void setRightTemplate(Integer rightTemplate) {
		this.rightTemplate = rightTemplate;
	}

	public String getNick() {
		return nick;
	}

	public void setNick(String nick) {
		this.nick = nick;
	}

	public String getStatusStr() {
		return statusStr;
	}

	public void setStatusStr(String statusStr) {
		this.statusStr = statusStr;
	}

	public String getIsShowStr() {
		return isShowStr;
	}

	public void setIsShowStr(String isShowStr) {
		this.isShowStr = isShowStr;
	}

	public String getCityName() {
		return cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	public Integer getTodoOrderCount() {
		return todoOrderCount;
	}

	public void setTodoOrderCount(Integer todoOrderCount) {
		this.todoOrderCount = todoOrderCount;
	}

	public String getPhotosImg() {
		return photosImg;
	}

	public void setPhotosImg(String photosImg) {
		this.photosImg = photosImg;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public Double getFeedbackScoreAvg() {
		return feedbackScoreAvg;
	}

	public void setFeedbackScoreAvg(Double feedbackScoreAvg) {
		this.feedbackScoreAvg = feedbackScoreAvg;
	}

	public Integer getFeedbackScore() {
		if (this.getFeedbackScoreAvg() == null) {
			feedbackScore = 5;
		} else {
			BigDecimal bigDecimal = new BigDecimal(this.getFeedbackScoreAvg()).setScale(0, BigDecimal.ROUND_HALF_UP);
			feedbackScore = bigDecimal.intValue();
		}
		return feedbackScore;
	}

	public void setFeedbackScore(Integer feedbackScore) {
		this.feedbackScore = feedbackScore;
	}

	public BigDecimal getX() {
		return x;
	}

	public void setX(BigDecimal x) {
		this.x = x;
	}

	public BigDecimal getY() {
		return y;
	}

	public void setY(BigDecimal y) {
		this.y = y;
	}

	public java.lang.String getServiceDateStr() {
		return serviceDateStr;
	}

	public void setServiceDateStr(java.lang.String serviceDateStr) {
		this.serviceDateStr = serviceDateStr;
	}

	public java.lang.String getServiceHourStr() {
		return serviceHourStr;
	}

	public void setServiceHourStr(java.lang.String serviceHourStr) {
		this.serviceHourStr = serviceHourStr;
	}

	public String getBirthPlace() {
		return birthPlace;
	}

	public void setBirthPlace(String birthPlace) {
		this.birthPlace = birthPlace;
	}

	public String getCommunityName() {
		return communityName;
	}

	public void setCommunityName(String communityName) {
		this.communityName = communityName;
	}
	
}